home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / Ex_INV.dxr / 00001.ls next >
Encoding:
Text File  |  1998-07-22  |  660 b   |  25 lines

  1. on startMovie
  2.   global x, y, r, theta, AnsW
  3.   cursor(-1)
  4.   set the cursor of sprite 20 to [319, 320]
  5.   set the cursor of sprite 21 to [319, 320]
  6.   set the randomSeed to the ticks
  7.   set the keyDownScript to "printPass"
  8.   set the keyUpScript to "numsOnly"
  9. end
  10.  
  11. on stopMovie
  12.   set the cursor of sprite 20 to 0
  13.   set the cursor of sprite 21 to 0
  14.   put 45 into field "Answer"
  15. end
  16.  
  17. on numsOnly
  18.   if (the key = ENTER) or (the key = RETURN) or (the keyCode = 76) then
  19.     exit
  20.   end if
  21.   if ((the key < "0") or (the key > "9")) and (the key <> "-") and (the key <> ".") and (the key <> numToChar(9)) and (the key <> numToChar(8)) then
  22.     dontPassEvent()
  23.   end if
  24. end
  25.